package models.common.bean;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;

import common.constants.ConfConst;
import common.constants.Constants;
import common.enums.IsCompany;
import common.utils.Security;
import models.common.entity.t_deal_user.OperationType;
import models.common.entity.t_recharge_user.Status;

/**
 * 会员充值
 *
 * @author liudong
 * @createDate 2016年2月24日
 */
@Entity
public class RechargeRecord {
	
	@Id
	public Long id;
	
	/** 业务订单号 */
	public String order_no; 
	
	/** 会员昵称 */
	public String name;
	
	/** 交易金额 */
	public double amount;
	
	/** 交易类型：1-充值；2-提现；3-放款；4-还款；5-投资 */
	/*public int operation_type;
	public OperationType getOperation_type() {
		OperationType dealType = OperationType.getEnum(this.operation_type);
		return dealType;
	}*/
	
	/** 充值时间 */
	public Date time;
	
	/**充值状态:-1-失败;0-处理中;1-成功;*/
	public int status;
	
	/** 企业类型 */
	public int is_company;
	
	/** 备注*/
	public String summary;
	
	public IsCompany getIsCompany(){
		IsCompany isCompany = IsCompany.getEnum(this.is_company);
		return isCompany;
	}
	
	/**加密id*/
	@Transient
	public String sign;
	public String getSign () {
		
		return Security.addSign(this.id, Constants.BID_ID_SIGN, ConfConst.ENCRYPTION_KEY_DES);
	}



	@Transient
	public String statusStr;
	public String getStatusStr () {
		Status status = Status.getEnum(this.status);
		return status.value;
	}
	
}
